package org.demo.restdocs.service.impl;

import org.demo.restdocs.dao.IUserDao;
import org.demo.restdocs.domain.User;
import org.demo.restdocs.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService implements IUserService {
    @Autowired
    private IUserDao userDao;

    @Override
    public int add(User user) {
        return this.userDao.add(user);
    }

    @Override
    public int update(User user) {
        return this.userDao.update(user);
    }

    @Override
    public int delete(long id) {
        return this.userDao.delete(id);
    }

    @Override
    public User findUserById(long id) {
        return this.userDao.findUserById(id);
    }

    @Override
    public List<User> findUserList() {
        return this.userDao.findUserList();
    }
}
